let arr1 = [1,2,3,1,2];
let arr2 = new Set([4,5,6,2,4]);
//交集
class Intersection{
    constructor(arr1,arr2){
        this.init();
    }
    init () {
        let arr = arr1.filter(function(item)
        {
            return arr2.has(item);
        })
        console.log(arr,'arr');
    }
}
var fn = new Intersection();
//并集
class union{
    constructor(arr1,arr2,brr1,brr2)
    {
        this.init();
    }
    init()
    {
        let arr3 = arr1.filter(function(item)
        {
            return !arr2.has(item);
        })
        let arr4 = brr2.filter(function(item)
        {
            return !brr1.has(item);
        })
        var arr5 = arr3.concat(arr4);
        console.log(arr5,'arr5');
    }
}
let brr1 = new Set([1,2,3,1,2]);
let brr2 = [4,5,6,2,4];
var fn1 = new union();